package com.ruoyi.report_gc.service.impl;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.domain.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.report_gc.domain.GcsyjcbgBsDetail;
import com.ruoyi.report_gc.domain.vo.GcsyjcbgBsDetailVo;
import com.ruoyi.report_gc.mapper.GcsyjcbgBsDetailMapper;
import com.ruoyi.syrw.annotation.ComputeReportResult;
import com.ruoyi.syrw.annotation.FIllBasicInfo;
import com.ruoyi.syrw.annotation.FIllBasicInfoForTaiZhang;
import com.ruoyi.report_tg.domain.TgsybgBaDetail;
import com.ruoyi.report_tg.domain.vo.TgsybgBaDetailVo;
import com.ruoyi.report_tg.mapper.TgsybgBaDetailMapper;
import com.ruoyi.sycs.service.IBiQualificationService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.ruoyi.report_gc.domain.bo.GcsyjcbgBsInfoBo;
import com.ruoyi.report_gc.domain.vo.GcsyjcbgBsInfoVo;
import com.ruoyi.report_gc.domain.GcsyjcbgBsInfo;
import com.ruoyi.report_gc.mapper.GcsyjcbgBsInfoMapper;
import com.ruoyi.report_gc.service.IGcsyjcbgBsInfoService;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Collection;

/**
 * 钢材试验检测报告Service业务层处理
 *
 * @author llb
 * @date 2024-06-21
 */
@RequiredArgsConstructor
@Service
public class GcsyjcbgBsInfoServiceImpl implements IGcsyjcbgBsInfoService {

    private final GcsyjcbgBsInfoMapper baseMapper;
    private final GcsyjcbgBsDetailMapper detailMapper;
    private final TgsybgBaDetailMapper tgDetailMapper;

    private final IBiQualificationService biQualificationService;

    private static final Long[] keys = {105L, 105L, 106L, 106L, 107L, 107L, 108L, 108L, 109L, 109L, 110L, 110L, 111L, 111L,
                                        105L, 105L, 106L, 106L, 107L, 107L, 108L, 108L, 109L, 109L, 110L, 110L, 111L, 111L,
                                        105L, 105L, 106L, 106L, 107L, 107L, 108L, 108L, 109L, 109L, 110L, 110L, 111L, 111L};

    /**
     * 查询钢材试验检测报告
     */
    @Override
    @FIllBasicInfo
    public GcsyjcbgBsInfoVo queryById(Long excelId){
        GcsyjcbgBsInfoVo gcsyjcbgBsInfoVo = baseMapper.selectVoById(excelId);
        List<GcsyjcbgBsDetailVo> detailList = detailMapper.selectVoList(
            new LambdaQueryWrapper<GcsyjcbgBsDetail>().eq(GcsyjcbgBsDetail::getExcelId, excelId));
        gcsyjcbgBsInfoVo.setDetailList(detailList);

        // 查询detail
        List<TgsybgBaDetailVo> baDetailVos = tgDetailMapper.selectVoList(new LambdaQueryWrapper<TgsybgBaDetail>()
            .eq(TgsybgBaDetail::getExcelId, excelId));
        baDetailVos.forEach(v->{
            v.setQualInfo(biQualificationService.queryById(v.getQualId()));
        });
        // 格式化 技术指标
        biQualificationService.compute(baDetailVos);
//        for(int i=0; i<baDetailVos.size(); i++){
//            if(i<=6){
//                if (!"-".equals(baDetailVos.get(i).getJiszb()) && ObjectUtils.isNotEmpty(baDetailVos.get(i).getJiancjg())){
//                    if ("不符合".equals(baDetailVos.get(i).getJiegpd())){
//                        baDetailVos.get(0).setJiegpd("不符合");
//                        break;
//                    }else {
//                        baDetailVos.get(0).setJiegpd("符合");
//                    }
//                }
//            }
//        }
//        for(int i=0; i<baDetailVos.size(); i++){
//            if(i>6&&i<=13){
//                if (!"-".equals(baDetailVos.get(i).getJiszb()) && ObjectUtils.isNotEmpty(baDetailVos.get(i).getJiancjg())){
//                    if ("不符合".equals(baDetailVos.get(i).getJiegpd())){
//                        baDetailVos.get(7).setJiegpd("不符合");
//                        break;
//                    }else {
//                        baDetailVos.get(7).setJiegpd("符合");
//                    }
//                }
//            }
//        }
//        for(int i=0; i<baDetailVos.size(); i++){
//            if(i>13){
//                if (!"-".equals(baDetailVos.get(i).getJiszb()) && ObjectUtils.isNotEmpty(baDetailVos.get(i).getJiancjg())){
//                    if ("不符合".equals(baDetailVos.get(i).getJiegpd())){
//                        baDetailVos.get(14).setJiegpd("不符合");
//                        break;
//                    }else {
//                        baDetailVos.get(14).setJiegpd("符合");
//                    }
//                }
//            }
//        }
        gcsyjcbgBsInfoVo.setBaDetailVos(baDetailVos);
        return gcsyjcbgBsInfoVo;
    }

    @Override
    @FIllBasicInfoForTaiZhang
    public GcsyjcbgBsInfoVo queryByIdForTaizhang(Long excelId) {
        GcsyjcbgBsInfoVo gcsyjcbgBsInfoVo = baseMapper.selectVoById(excelId);
        List<GcsyjcbgBsDetailVo> detailList = detailMapper.selectVoList(
            new LambdaQueryWrapper<GcsyjcbgBsDetail>().eq(GcsyjcbgBsDetail::getExcelId, excelId));
        gcsyjcbgBsInfoVo.setDetailList(detailList);

        // 查询detail
        List<TgsybgBaDetailVo> baDetailVos = tgDetailMapper.selectVoList(new LambdaQueryWrapper<TgsybgBaDetail>()
            .eq(TgsybgBaDetail::getExcelId, excelId));
        baDetailVos.forEach(v->{
            v.setQualInfo(biQualificationService.queryById(v.getQualId()));
        });
        // 格式化 技术指标
        biQualificationService.compute(baDetailVos);
        gcsyjcbgBsInfoVo.setBaDetailVos(baDetailVos);

        //台账
        for(int i = 0; i<detailList.size(); i++){
            //屈服强度检测结果台账
            if (ObjectUtils.isNotEmpty(detailList.get(i).getQvfqdjcjg())){
                if (ObjectUtils.isEmpty(gcsyjcbgBsInfoVo.getQvfqdjcjgTizhang())){
                    gcsyjcbgBsInfoVo.setQvfqdjcjgTizhang(detailList.get(i).getQvfqdjcjg());
                }else {
                    gcsyjcbgBsInfoVo.setQvfqdjcjgTizhang(gcsyjcbgBsInfoVo.getQvfqdjcjgTizhang()+"/"+detailList.get(i).getQvfqdjcjg());
                }
            }
            //抗拉强度检测结果台账
            if (ObjectUtils.isNotEmpty(detailList.get(i).getKanglqdjcjg())){
                if (ObjectUtils.isEmpty(gcsyjcbgBsInfoVo.getKanglqdjcjgTizhang())){
                    gcsyjcbgBsInfoVo.setKanglqdjcjgTizhang(detailList.get(i).getKanglqdjcjg());
                }else {
                    gcsyjcbgBsInfoVo.setKanglqdjcjgTizhang(gcsyjcbgBsInfoVo.getKanglqdjcjgTizhang()+"/"+detailList.get(i).getKanglqdjcjg());
                }
            }
            //断后伸长率检测结果台账
            if (ObjectUtils.isNotEmpty(detailList.get(i).getDuanhscljcjg())){
                if (ObjectUtils.isEmpty(gcsyjcbgBsInfoVo.getDuanhscljcjgTizhang())){
                    gcsyjcbgBsInfoVo.setDuanhscljcjgTizhang(detailList.get(i).getDuanhscljcjg());
                }else {
                    gcsyjcbgBsInfoVo.setDuanhscljcjgTizhang(gcsyjcbgBsInfoVo.getDuanhscljcjgTizhang()+"/"+detailList.get(i).getDuanhscljcjg());
                }
            }
            //最大力总延伸率检测结果台账
            if (ObjectUtils.isNotEmpty(detailList.get(i).getZuidlzysljcjg())){
                if (ObjectUtils.isEmpty(gcsyjcbgBsInfoVo.getZuidlzysljcjgTizhang())){
                    gcsyjcbgBsInfoVo.setZuidlzysljcjgTizhang(detailList.get(i).getZuidlzysljcjg());
                }else {
                    gcsyjcbgBsInfoVo.setZuidlzysljcjgTizhang(gcsyjcbgBsInfoVo.getZuidlzysljcjgTizhang()+"/"+detailList.get(i).getZuidlzysljcjg());
                }
            }
            //强屈比检测结果台账
            if (ObjectUtils.isNotEmpty(detailList.get(i).getQiangqbjcjg())){
                if (ObjectUtils.isEmpty(gcsyjcbgBsInfoVo.getQiangqbjcjgTizhang())){
                    gcsyjcbgBsInfoVo.setQiangqbjcjgTizhang(detailList.get(i).getQiangqbjcjg());
                }else {
                    gcsyjcbgBsInfoVo.setQiangqbjcjgTizhang(gcsyjcbgBsInfoVo.getQiangqbjcjgTizhang()+"/"+detailList.get(i).getQiangqbjcjg());
                }
            }
            //屈屈比检测结果台账
            if (ObjectUtils.isNotEmpty(detailList.get(i).getQvqbjcjg())){
                if (ObjectUtils.isEmpty(gcsyjcbgBsInfoVo.getQvqbjcjgTizhang())){
                    gcsyjcbgBsInfoVo.setQvqbjcjgTizhang(detailList.get(i).getQvqbjcjg());
                }else {
                    gcsyjcbgBsInfoVo.setQvqbjcjgTizhang(gcsyjcbgBsInfoVo.getQvqbjcjgTizhang()+"/"+detailList.get(i).getQvqbjcjg());
                }
            }
            //断裂特征台账
            if (ObjectUtils.isNotEmpty(detailList.get(i).getDaunltz())){
                if (ObjectUtils.isEmpty(gcsyjcbgBsInfoVo.getDaunltzTizhang())){
                    gcsyjcbgBsInfoVo.setDaunltzTizhang(detailList.get(i).getDaunltz());
                }else {
                    gcsyjcbgBsInfoVo.setDaunltzTizhang(gcsyjcbgBsInfoVo.getDaunltzTizhang()+"/"+detailList.get(i).getDaunltz());
                }
            }
            //弯曲性能检测结果台账
            if (ObjectUtils.isNotEmpty(detailList.get(i).getWanqxnjcjg())){
                if (ObjectUtils.isEmpty(gcsyjcbgBsInfoVo.getWanqxnjcjgTizhang())){
                    gcsyjcbgBsInfoVo.setWanqxnjcjgTizhang(detailList.get(i).getWanqxnjcjg());
                }else {
                    gcsyjcbgBsInfoVo.setWanqxnjcjgTizhang(gcsyjcbgBsInfoVo.getWanqxnjcjgTizhang()+"/"+detailList.get(i).getWanqxnjcjg());
                }
            }
            //反向弯曲性能检测结果台账
            if (ObjectUtils.isNotEmpty(detailList.get(i).getFanxwqxnjcjg())){
                if (ObjectUtils.isEmpty(gcsyjcbgBsInfoVo.getFanxwqxnjcjgTizhang())){
                    gcsyjcbgBsInfoVo.setFanxwqxnjcjgTizhang(detailList.get(i).getFanxwqxnjcjg());
                }else {
                    gcsyjcbgBsInfoVo.setFanxwqxnjcjgTizhang(gcsyjcbgBsInfoVo.getFanxwqxnjcjgTizhang()+"/"+detailList.get(i).getFanxwqxnjcjg());
                }
            }
            //重量偏差检测结果台账
            if (ObjectUtils.isNotEmpty(detailList.get(i).getZhonglpcjcjg())){
                if (ObjectUtils.isEmpty(gcsyjcbgBsInfoVo.getZhonglpcjcjgTizhang())){
                    gcsyjcbgBsInfoVo.setZhonglpcjcjgTizhang(detailList.get(i).getZhonglpcjcjg());
                }else {
                    gcsyjcbgBsInfoVo.setZhonglpcjcjgTizhang(gcsyjcbgBsInfoVo.getZhonglpcjcjgTizhang()+"/"+detailList.get(i).getZhonglpcjcjg());
                }
            }
        }
        return gcsyjcbgBsInfoVo;
    }

    /**
     * 查询钢材试验检测报告列表
     */
    @Override
    public TableDataInfo<GcsyjcbgBsInfoVo> queryPageList(GcsyjcbgBsInfoBo bo, PageQuery pageQuery) {
        LambdaQueryWrapper<GcsyjcbgBsInfo> lqw = buildQueryWrapper(bo);
        Page<GcsyjcbgBsInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
        return TableDataInfo.build(result);
    }

    /**
     * 查询钢材试验检测报告列表
     */
    @Override
    public List<GcsyjcbgBsInfoVo> queryList(GcsyjcbgBsInfoBo bo) {
        LambdaQueryWrapper<GcsyjcbgBsInfo> lqw = buildQueryWrapper(bo);
        return baseMapper.selectVoList(lqw);
    }

    private LambdaQueryWrapper<GcsyjcbgBsInfo> buildQueryWrapper(GcsyjcbgBsInfoBo bo) {
        Map<String, Object> params = bo.getParams();
        LambdaQueryWrapper<GcsyjcbgBsInfo> lqw = Wrappers.lambdaQuery();
        lqw.eq(bo.getTotalPage() != null, GcsyjcbgBsInfo::getTotalPage, bo.getTotalPage());
        lqw.eq(bo.getPage() != null, GcsyjcbgBsInfo::getPage, bo.getPage());
        lqw.eq(StringUtils.isNotBlank(bo.getJiancdwmc()), GcsyjcbgBsInfo::getJiancdwmc, bo.getJiancdwmc());
        lqw.eq(StringUtils.isNotBlank(bo.getBaogbh()), GcsyjcbgBsInfo::getBaogbh, bo.getBaogbh());
        lqw.eq(StringUtils.isNotBlank(bo.getShigwtdw()), GcsyjcbgBsInfo::getShigwtdw, bo.getShigwtdw());
        lqw.eq(StringUtils.isNotBlank(bo.getGongcmc()), GcsyjcbgBsInfo::getGongcmc, bo.getGongcmc());
        lqw.eq(StringUtils.isNotBlank(bo.getGongcbwyt()), GcsyjcbgBsInfo::getGongcbwyt, bo.getGongcbwyt());
        lqw.eq(StringUtils.isNotBlank(bo.getYangpmc()), GcsyjcbgBsInfo::getYangpmc, bo.getYangpmc());
        lqw.eq(StringUtils.isNotBlank(bo.getYangpbh()), GcsyjcbgBsInfo::getYangpbh, bo.getYangpbh());
        lqw.eq(StringUtils.isNotBlank(bo.getYangpsl()), GcsyjcbgBsInfo::getYangpsl, bo.getYangpsl());
        lqw.eq(StringUtils.isNotBlank(bo.getYangpzt()), GcsyjcbgBsInfo::getYangpzt, bo.getYangpzt());
        lqw.eq(StringUtils.isNotBlank(bo.getYangpsj()), GcsyjcbgBsInfo::getYangpsj, bo.getYangpsj());
        lqw.eq(StringUtils.isNotBlank(bo.getJiancyj()), GcsyjcbgBsInfo::getJiancyj, bo.getJiancyj());
        lqw.eq(StringUtils.isNotBlank(bo.getPandyj()), GcsyjcbgBsInfo::getPandyj, bo.getPandyj());
        lqw.eq(StringUtils.isNotBlank(bo.getZhuyyqsbmcjbh()), GcsyjcbgBsInfo::getZhuyyqsbmcjbh, bo.getZhuyyqsbmcjbh());
        lqw.eq(StringUtils.isNotBlank(bo.getJiancjl()), GcsyjcbgBsInfo::getJiancjl, bo.getJiancjl());
        lqw.eq(StringUtils.isNotBlank(bo.getFujsm()), GcsyjcbgBsInfo::getFujsm, bo.getFujsm());
        lqw.eq(StringUtils.isNotBlank(bo.getBgFlag()), GcsyjcbgBsInfo::getBgFlag, bo.getBgFlag());
        lqw.eq(StringUtils.isNotBlank(bo.getJianc()), GcsyjcbgBsInfo::getJianc, bo.getJianc());
        lqw.eq(StringUtils.isNotBlank(bo.getJil()), GcsyjcbgBsInfo::getJil, bo.getJil());
        lqw.eq(StringUtils.isNotBlank(bo.getFuh()), GcsyjcbgBsInfo::getFuh, bo.getFuh());
        lqw.eq(StringUtils.isNotBlank(bo.getRiq()), GcsyjcbgBsInfo::getRiq, bo.getRiq());
        lqw.eq(StringUtils.isNotBlank(bo.getShebIds()), GcsyjcbgBsInfo::getShebIds, bo.getShebIds());
        lqw.eq(StringUtils.isNotBlank(bo.getPandyjIds()), GcsyjcbgBsInfo::getPandyjIds, bo.getPandyjIds());
        lqw.eq(StringUtils.isNotBlank(bo.getJiancyjIds()), GcsyjcbgBsInfo::getJiancyjIds, bo.getJiancyjIds());
        return lqw;
    }

    /**
     * 新增钢材试验检测报告
     */
    @Override
    @DSTransactional
    public Boolean insertByBo(GcsyjcbgBsInfoBo bo) {
        GcsyjcbgBsInfo add = BeanUtil.toBean(bo, GcsyjcbgBsInfo.class);
        validEntityBeforeSave(add);
        boolean flag = baseMapper.insert(add) > 0;
        if (flag) {
            bo.setExcelId(add.getExcelId());
            ArrayList<GcsyjcbgBsDetail> details = new ArrayList<>(6);
            for (int i=1;i<=6;i++ ){
                details.add(new GcsyjcbgBsDetail(bo.getExcelId()));
            }
            detailMapper.insertBatch(details);


            // 新增详细 多个keys
            ArrayList<TgsybgBaDetail> tgDetails = new ArrayList<>(42);
            for (Long key : keys) {
                tgDetails.add(new TgsybgBaDetail(add.getExcelId(), key));
            }
            tgDetailMapper.insertBatch(tgDetails);
        }
        return flag;
    }

    /**
     * 修改钢材试验检测报告
     */
    @Override
    @DSTransactional
    @ComputeReportResult
    public Boolean updateByBo(GcsyjcbgBsInfoBo bo) {
        // 增加对 是否合格 的填充
        fillExcelResult(bo);
        GcsyjcbgBsInfo update = BeanUtil.toBean(bo, GcsyjcbgBsInfo.class);
        validEntityBeforeSave(update);
        boolean flag = baseMapper.updateById(update) > 0;
        if (flag) {
            detailMapper.updateBatchById(BeanUtil.copyToList(bo.getDetailList(), GcsyjcbgBsDetail.class));

            tgDetailMapper.updateBatchById(BeanUtil.copyToList(bo.getBaDetailVos(), TgsybgBaDetail.class));
        }
        return flag;
    }

    private void fillExcelResult(GcsyjcbgBsInfoBo bo) {
        if (CollUtil.isNotEmpty(bo.getDetailList())) {
            for (GcsyjcbgBsDetailVo detailVo : bo.getDetailList()) {
                if ("不符合".equals(detailVo.getShiyjg())) {
                    bo.setExcelResult(2);
                    return;
                }
            }
            bo.setExcelResult(1);
        }
        bo.setExcelResult(0);

    }

    public boolean isWell(Long excelId) {
        return baseMapper.selectVoById(excelId).getExcelResult() != 2;
    }

    /**
     * 保存前的数据校验
     */
    private void validEntityBeforeSave(GcsyjcbgBsInfo entity){
        //TODO 做一些数据校验,如唯一约束
    }

    /**
     * 批量删除钢材试验检测报告
     */
    @Override
    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
        if(isValid){
            //TODO 做一些业务上的校验,判断是否需要校验
        }
        return baseMapper.deleteBatchIds(ids) > 0;
    }

    @Override
    public GcsyjcbgBsInfoVo jcjl(GcsyjcbgBsInfoVo vo) {
        StringBuilder result = new StringBuilder("检测结论：经检测，该批钢筋所检指标符合《钢筋混凝土用钢第2部分热轧带肋钢筋》(GB/T1499.2-2018)的技术要求。");
        vo.setJiancjl(result.toString());
        return vo;
    }

    @Override
    public GcsyjcbgBsInfoVo compute(GcsyjcbgBsInfoVo vo) {
        // 格式化 技术指标
        biQualificationService.compute(vo.getBaDetailVos());
        List<GcsyjcbgBsDetailVo> detailList = vo.getDetailList();
        for (int i=0; i<=vo.getBaDetailVos().size(); i++){
            switch (i) {
                case 0:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(0).setQvfqdjszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(0).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(0).setShiyjg("符合");
                        }
                    }
                    break;
                case 1:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(0).setKanglqdjszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(0).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(0).setShiyjg("符合");
                        }
                    }
                    break;
                case 2:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(0).setDuanhscljszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(0).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(0).setShiyjg("符合");
                        }
                    }
                    break;
                case 3:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(0).setZuidlzysljszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(0).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(0).setShiyjg("符合");
                        }
                    }
                    break;
                case 4:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(0).setQiangqbjszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(0).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(0).setShiyjg("符合");
                        }
                    }
                    break;
                case 5:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(0).setQvqbjszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(0).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(0).setShiyjg("符合");
                        }
                    }
                    break;
                case 6:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(0).setZhonglpcjszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(0).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(0).setShiyjg("符合");
                        }
                    }
                    break;

                case 7:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(1).setQvfqdjszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(1).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(1).setShiyjg("符合");
                        }
                    }
                    break;
                case 8:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(1).setKanglqdjszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(1).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(1).setShiyjg("符合");
                        }
                    }
                    break;
                case 9:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(1).setDuanhscljszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(1).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(1).setShiyjg("符合");
                        }
                    }
                    break;
                case 10:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(1).setZuidlzysljszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(1).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(1).setShiyjg("符合");
                        }
                    }
                    break;
                case 11:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(1).setQiangqbjszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(1).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(1).setShiyjg("符合");
                        }
                    }
                    break;
                case 12:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(1).setQvqbjszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(1).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(1).setShiyjg("符合");
                        }
                    }
                    break;
                case 13:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(1).setZhonglpcjszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(1).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(1).setShiyjg("符合");
                        }
                    }
                    break;

                case 14:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(2).setQvfqdjszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(2).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(2).setShiyjg("符合");
                        }
                    }
                    break;
                case 15:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(2).setKanglqdjszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(2).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(2).setShiyjg("符合");
                        }
                    }
                    break;
                case 16:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(2).setDuanhscljszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(2).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(2).setShiyjg("符合");
                        }
                    }
                    break;
                case 17:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(2).setZuidlzysljszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(2).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(2).setShiyjg("符合");
                        }
                    }
                    break;
                case 18:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(2).setQiangqbjszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(2).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(2).setShiyjg("符合");
                        }
                    }
                    break;
                case 19:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(2).setQvqbjszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(2).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(2).setShiyjg("符合");
                        }
                    }
                    break;
                case 20:
                    if (!"-".equals(vo.getBaDetailVos().get(i).getJiszb())){
                        TgsybgBaDetailVo baDetailVo = vo.getBaDetailVos().get(i);
                        vo.getDetailList().get(2).setZhonglpcjszb(baDetailVo.getJiszb());
                        if ("不符合".equals(baDetailVo.getJiegpd())){
                            vo.getDetailList().get(2).setShiyjg("不符合");
                        }else {
                            vo.getDetailList().get(2).setShiyjg("符合");
                        }
                    }
                    break;
            }
        }
        return null;

    }
}
